package com.bee.beemanage.api.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bee.beemanage.api.entity.SysPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author 陈国松
 * @since 2022-10-09
 */
@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
    /**
     * 根据用户id获取用户的所有权限
     * @param userId
     * @return
     */
    List<SysPermission> selectListByUserId(@Param("userId") String userId);

    Page<SysPermission> recycleSearch(Page<SysPermission> page, @Param("sysPermission")SysPermission sysPermission, @Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);

    boolean recover(List<String> ids);

    boolean clear();
}
